package org.restoran.service.parser.dto;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableMap;
import org.codehaus.jackson.map.ObjectMapper;
import org.restoran.service.parser.Parser;

import java.io.Writer;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @author Snisar Bogdan.
 */
public class DtoBeanParser implements Parser {

    private final ObjectMapper jsonParser;

    public DtoBeanParser(ObjectMapper jsonParser) {
        this.jsonParser = jsonParser;
    }

    private ImmutableListMultimap<Object, Object> map;


    public void registerDtoMapping(Map<Object, List<Object>> map) {
        ImmutableListMultimap.Builder<Object, Object> builder = ImmutableListMultimap.builder();

        for(Map.Entry<Object, List<Object>> e : map.entrySet())
            builder.putAll(e.getKey(), e.getValue());

        this.map = builder.build();
    }






    @Override
    public <E> String toJson(E entity) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public <E> void toJson(Writer writer, E entity) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public <E> String toJson(Collection<E> objects) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public <E> void toJson(Writer writer, Collection<E> args) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public <E> E fromJson(String json, Class<E> type) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
}
